package net.huashitong.service.money;

import net.huashitong.mapper.money.SsMoneyVipBagMapper;
import net.huashitong.ssydt.money.entity.SsMoneyVipBag;
import net.huashitong.ssydt.money.entity.vo.SsMoneyVipBagInVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author shaoxian.zhong
 * @create 2018-06-25 20:12
 */
@Service
@Transactional
public class SsMoneyVipBagServiceImpl implements SsMoneyVipBagService {
    @Autowired
    private SsMoneyVipBagMapper mapper;

    @Override
    public List<SsMoneyVipBag> queryByState() {
        return this.mapper.queryByState(SsMoneyVipBag.State.SHOW);
    }

    @Override
    public List<SsMoneyVipBag> queryByAppType(String appType) {
        SsMoneyVipBagInVO ssMoneyVipBagInVO = new SsMoneyVipBagInVO();
        ssMoneyVipBagInVO.setAppType(appType);
        ssMoneyVipBagInVO.setState(SsMoneyVipBag.State.SHOW);

        return this.mapper.queryByAppType(ssMoneyVipBagInVO);
    }

    @Override
    public SsMoneyVipBag getById(Long goodsId) {
        return mapper.selectByPrimaryKey(goodsId);
    }
}
